<%--
  Created by IntelliJ IDEA.
  User: zlq
  Date: 2022/5/14
  Time: 15:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>下载页面</title>
</head>
<body>
<h2>Springmvc文件下载</h2>
个人照片<a href="/download/个人照片.png">个人照片.png</a><br>
个人简历<a href="/download/个人简历.pdf">个人简历.pdf</a>
<form action="" id="form"
      method="get" enctype="multipart/form-data">
    <input type="text" name="fileName" id="fileName">
    <input type="submit" value="下载文件" onclick="a()">
</form>
<script>
    function a(){
        var fileName = document.getElementById("fileName").value;
        document.getElementById("form").action = "/download/" + fileName;
        // document.getElementById("form").submit;
    }
</script>
</body>
</html>
